package com.hry.ssm.service.impl;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hry.ssm.entity.User;
import com.hry.ssm.mapper.UserMapper;
import com.hry.ssm.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;


    @Override
    public List<User> list(int page, int size) {
        Page<User> userPage = PageHelper.startPage(page, size).doSelectPage(() -> userMapper.selectList());

        List<User> result = userPage.getResult();

        return result;
    }

    @Override
    public int add(User user) {
        return 0;
    }

}
